﻿<Window x:Class="DTC.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Главное Окно" Height="600" Width="920" Opacity="1" 
        MinHeight="500" MinWidth="650" WindowStyle="None" 
        ResizeMode="CanResizeWithGrip" AllowsTransparency="True" 
        Visibility="Visible" Background="{x:Null}" SnapsToDevicePixels="True"
        Name="win">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/ButtonsStyles.xaml"/>
                <ResourceDictionary Source="Resources/Brushes.xaml"/>
            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>
    </Window.Resources>
    <Window.BitmapEffect>
        <DropShadowBitmapEffect Color="Black" Direction="320" ShadowDepth="25" Softness="1" 
         Opacity="0.5"/>
    </Window.BitmapEffect>

    <Border BorderBrush="Gray" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
		<Border.Background>
			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
				<GradientStop Color="#FF515984" Offset="1"/>
				<GradientStop Color="#FF8F99D5" Offset="0"/>
				<GradientStop Color="#FF4F5573" Offset="0.406"/>
				<GradientStop Color="#FF7078A7" Offset="0.768"/>
			</LinearGradientBrush>
		</Border.Background>
        <Grid Margin="0,0,0,2" Background="{x:Null}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="15" MaxHeight="19"/>
                <RowDefinition Height="5"/>
                <RowDefinition Height="0.01*" MinHeight="5" MaxHeight="25"/>
                <RowDefinition Height="70"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Border Background="{StaticResource WindowHeaderGradient}"
                    Grid.Row="0" 
                    Grid.ColumnSpan="2" Grid.RowSpan="2"
                    CornerRadius="4,4,0,0"
                    BorderBrush="Gray"
                    BorderThickness="0,0,0,1">
                <Grid x:Name="TitleBar" VerticalAlignment="Top" MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock x:Name="TitleText" Grid.Column="1" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" Background="{x:Null}" IsHyphenationEnabled="False" SnapsToDevicePixels="True" FontWeight="Bold" Text="Детский Гематологический Центр"/>
                    <Border Grid.Column="2" Margin="0,0,2,2" BorderThickness="0" MinWidth="100" MinHeight="14" MaxHeight="20" HorizontalAlignment="Stretch" VerticalAlignment="Top" BorderBrush="Gray" Background="Transparent" CornerRadius="0,0,0,0"  SnapsToDevicePixels="True">
                        <WrapPanel HorizontalAlignment="Right" VerticalAlignment="Top">
                            <Button x:Name="MinimizeButton" Width="20" Margin="0,0,0,1" HorizontalAlignment="Right" VerticalAlignment="Stretch" BorderBrush="#FF4293DE" Style="{StaticResource ControlButton}" Click="MinimizeButton_Click">
                                <Path Grid.RowSpan="2" Margin="3,7,5,0" VerticalAlignment="Center" HorizontalAlignment="Center" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFFFFFFF" Data="M 0,0 L1,0" StrokeThickness="2"/>
                            </Button>
                            <Button x:Name="MaximizeButton" Width="20" Margin="0,0,0,1" HorizontalAlignment="Right" VerticalAlignment="Stretch" BorderBrush="#FF4293DE" Style="{StaticResource ControlButton}" Click="SizeButton_Click">
                                <Grid Margin="4,2,4,2">
                                    <Path VerticalAlignment="Bottom" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L1,0" Margin="0,0,3,0"/>
                                    <Path HorizontalAlignment="Left"  Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L0,1" Margin="0,3,0,0"/>
                                    <Path VerticalAlignment="Top" Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,1L1,1" Margin="0,3,3,0" StrokeThickness="2"/>
                                    <Path HorizontalAlignment="Right" Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L0,1" Margin="0,3,3,0"/>
                                    <Path VerticalAlignment="Bottom" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L1,0" Margin="7,0,0,3"/>
                                    <Path HorizontalAlignment="Left"  Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L0,1" Margin="3,0,0,7"/>
                                    <Path VerticalAlignment="Top" Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,1L1,1" Margin="3,0,0,0" StrokeThickness="2"/>
                                    <Path HorizontalAlignment="Right" Fill="#FF000000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M0,0L0,1" Margin="0,0,0,3"/>
                                    
                                </Grid>
                            </Button>
                            <Button x:Name="CloseButton" Style="{StaticResource CloseControlButton}" Width="20" Margin="0,0,3,1" HorizontalAlignment="Right" VerticalAlignment="Stretch" BorderBrush="Red"  Click="CloseButton_Click">
                                <Grid Margin="3,2,4,3" >
                                    <Path Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFFFFFFF" Data="M 0,0 L1,1" StrokeThickness="2"/>
                                    <Path Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" Fill="#FFFF0000" Stretch="Fill" Stroke="#FFFFFFFF" Data="M 0,1 L1,0" StrokeThickness="2"/>
                                </Grid>
                            </Button>
                        </WrapPanel>
                    </Border>
                </Grid>
            </Border>
			<Border VerticalAlignment="Stretch"
                   HorizontalAlignment="Stretch"
				   SnapsToDevicePixels="True"
				   Grid.Column="0" Grid.Row="4" 
                   Margin="6,0,6,6"
				   BorderThickness="1,0,1,1" 
				   CornerRadius="3"
				   Background="{StaticResource WindowBackground}">
				   <Border.BorderBrush>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#FF535353" Offset="1"/>
							<GradientStop Color="#FFA5A5A5" Offset="0"/>
						</LinearGradientBrush>
					</Border.BorderBrush>
                <Frame Name="DisplayArea" NavigationUIVisibility="Hidden"
						HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch"
						VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"/>
			</Border>            
            <Grid x:Name="MenuBar" SnapsToDevicePixels="True" VerticalAlignment="Center" Grid.Row="3" Margin="100,0,100,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.33*"/>
                    <ColumnDefinition Width="0.33*"/>
                    <ColumnDefinition Width="0.33*"/>
                </Grid.ColumnDefinitions>
                <RadioButton Grid.Column="0" Name="MedRecListButton" 
							Height="50"
							Margin="6,0,6,0"
							Style="{StaticResource MenuButton}" 
							Click="MedRecListButton_Click" 
							IsChecked="False" 
							SnapsToDevicePixels="True" 
							FontSize="12" 
							FontWeight="Bold">Медицинские карты</RadioButton>
                <RadioButton Grid.Column="1" Name="DrugManagementButton" 
							Height="50"
							Margin="6,0,6,0" 
							Style="{StaticResource MenuButton}" 
							Click="DrugManagementButton_Click" 
							SnapsToDevicePixels="True" 
							FontSize="12" 
							FontWeight="Bold">Учет препаратов</RadioButton>
                <RadioButton Grid.Column="2" 
							Name="JournalButton" 
							Height="50" 
							Margin="6,0,6,0"
							Style="{StaticResource MenuButton}" 
							Click="JournalButton_Click" 
							SnapsToDevicePixels="True"
							 FontSize="12" 
							 FontWeight="Bold">Журнал приемов</RadioButton>
            </Grid>
        </Grid>
    </Border>
</Window>
